package com.itheima_01.monitest.second.test1;

import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        Student stu1 = new Student("小黑", 88);
        Student stu2 = new Student("小马", 92);
        Student stu3 = new Student("小智", 75);

        ArrayList<Student> array = new ArrayList<>();
        array.add(stu1);
        array.add(stu2);
        array.add(stu3);
        //System.out.println(array.size());
        String[] strings = new String[array.size()];
        int sum = 0;
        for (int i = 0; i < array.size(); i++) {
            int score = array.get(i).getScore();
            sum += score;
        }
        int avg=sum/3;
        System.out.println("三个学生的平均成绩是："+avg);

    }

}
